home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / ncuerm10.zip / MAIN.TXT < prev    next >
Text File  |  1994-04-14  |  49KB  |  1,220 lines

  1. Dim DragIt As Integer
  2. Dim DragX As Single, DragY As Single
  3. Dim MaxFont As Integer
  4. Dim TextNo As Integer
  5. Dim CheckMouseDownInClientArea As Integer
  6.  
  7. Sub CheckMouseDown (X As Single, Y As Single)
  8.     Dim i As Integer
  9.     Dim XL, XR, YU, YD As Single
  10.     
  11.     SelectObject$ = "pointer"
  12.     For i = 1 To 1000
  13.       'Check Text
  14.       If (i <= MaxText) And (DataText(i) = 1) Then
  15.         If (X >= Text1(i).Left) And (X < Text1(i).Left + Text1(i).Width) And (Y >= Text1(i).Top) And (Y < Text1(i).Top + Text1(i).Height) Then
  16.           SelectObject$ = "text"
  17.           TextNo = i
  18.           Call TextAttrib(Text1(i))
  19.           Call Shape_FourDotMove(Text1(i))
  20.           menuText.Enabled = True
  21.           Exit Sub
  22.         End If
  23.       End If
  24.     Next i
  25.  
  26.     menuText.Enabled = False
  27.     For i = 1 To 1000
  28.       'Check Line
  29.       If (i <= MaxLine) And (DataLine(i) = 1) Then
  30.         If Line1(i).X1 < Line1(i).X2 Then XL = Line1(i).X1: XR = Line1(i).X2 Else XR = Line1(i).X1: XL = Line1(i).X2
  31.         If Line1(i).Y1 < Line1(i).Y2 Then YU = Line1(i).Y1: YD = Line1(i).Y2 Else YD = Line1(i).Y1: YU = Line1(i).Y2
  32.         If (X >= XL - 15) And (X <= XR + 30) And (Y >= YU - 15) And (Y <= YD + 30) Then
  33.           SelectObject$ = "line"
  34.           'Change tools.PointerStyle & tools.PointerWidth
  35.           tools.PointerStyle.Top = 1920 + Line1(i).BorderStyle * 120
  36.           tools.PointerWidth.Top = 2880 + Line1(i).BorderWidth * 120
  37.           CurrentNo = i
  38.           Call Line_TwoDotMove(Line1(i))
  39.           Exit Sub
  40.         End If
  41.       End If
  42.  
  43.       'Check Diamond
  44.       If (i <= MaxDiamond) And (DataDiamond(i) = 1) Then
  45.         If (X >= Diamond(i).Left) And (X < Diamond(i).Left + Diamond(i).Width) And (Y >= Diamond(i).Top) And (Y < Diamond(i).Top + Diamond(i).Height) Then
  46.           SelectObject$ = "diamond"
  47.           'Change tools.PointerStyle & tools.PointerWidth
  48.           tools.PointerStyle.Top = 1920 + Diamond(i).BorderStyle * 120
  49.           tools.PointerWidth.Top = 2880 + Diamond(i).BorderWidth * 120
  50.           CurrentNo = i
  51.           Call Shape_FourDotMove(Diamond(i))
  52.           Exit Sub
  53.         End If
  54.       End If
  55.  
  56.       'Check Circle
  57.       If (i <= MaxCircle) And (DataCircle(i) = 1) Then
  58.         If (X >= Circle1(i).Left) And (X < Circle1(i).Left + Circle1(i).Width) And (Y >= Circle1(i).Top) And (Y < Circle1(i).Top + Circle1(i).Height) Then
  59.           SelectObject$ = "circle"
  60.           'Change tools.PointerStyle & tools.PointerWidth
  61.           tools.PointerStyle.Top = 1920 + Circle1(i).BorderStyle * 120
  62.           tools.PointerWidth.Top = 2880 + Circle1(i).BorderWidth * 120
  63.           CurrentNo = i
  64.           Call Shape_FourDotMove(Circle1(i))
  65.           Exit Sub
  66.         End If
  67.       End If
  68.       
  69.       'Check RoundRectangle
  70.       If (i <= MaxRoundrectangle) And (DataRoundrectangle(i) = 1) Then
  71.         If (X >= Roundrectangle1(i).Left) And (X < Roundrectangle1(i).Left + Roundrectangle1(i).Width) And (Y >= Roundrectangle1(i).Top) And (Y < Roundrectangle1(i).Top + Roundrectangle1(i).Height) Then
  72.           SelectObject$ = "roundrectangle"
  73.           'Change tools.PointerStyle & tools.PointerWidth
  74.           tools.PointerStyle.Top = 1920 + Roundrectangle1(i).BorderStyle * 120
  75.           tools.PointerWidth.Top = 2880 + Roundrectangle1(i).BorderWidth * 120
  76.           CurrentNo = i
  77.           Call Shape_FourDotMove(Roundrectangle1(i))
  78.           Exit Sub
  79.         End If
  80.       End If
  81.       
  82.       'Check Rectangle
  83.       If (i <= MaxRectangle) And (DataRectangle(i) = 1) Then
  84.         If (X >= Rectangle1(i).Left) And (X < Rectangle1(i).Left + Rectangle1(i).Width) And (Y >= Rectangle1(i).Top) And (Y < Rectangle1(i).Top + Rectangle1(i).Height) Then
  85.           SelectObject$ = "rectangle"
  86.           'Change tools.PointerStyle & tools.PointerWidth
  87.           tools.PointerStyle.Top = 1920 + Rectangle1(i).BorderStyle * 120
  88.           tools.PointerWidth.Top = 2880 + Rectangle1(i).BorderWidth * 120
  89.           CurrentNo = i
  90.           Call Shape_FourDotMove(Rectangle1(i))
  91.           Exit Sub
  92.         End If
  93.       End If
  94.     Next i
  95.  
  96. End Sub
  97.  
  98. Sub Dot1_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  99.     If Button = 1 Then Call DotAllHide
  100. End Sub
  101.  
  102. Sub Dot1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  103.     Dot1.MousePointer = 2
  104.     If (Button = 1) And (SelectObject$ = "line") Then
  105.       Line1(CurrentNo).X1 = Dot1.Left + X
  106.       Line1(CurrentNo).Y1 = Dot1.Top + Y
  107.     End If
  108. End Sub
  109.  
  110. Sub Dot1_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  111.     If (Button = 1) And (SelectObject$ = "line") Then
  112.       Dot1.Move (Line1(CurrentNo).X1 - Dot1.Width / 2), (Line1(CurrentNo).Y1 - Dot1.Height / 2)
  113.       Dot1.Visible = True: Dot2.Visible = True
  114.     End If
  115. End Sub
  116.  
  117. Sub Dot2_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  118.     If Button = 1 Then Call DotAllHide
  119. End Sub
  120.  
  121. Sub Dot2_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  122.     Dot2.MousePointer = 2
  123.     If (Button = 1) And (SelectObject$ = "line") Then
  124.       Line1(CurrentNo).X2 = Dot2.Left + X
  125.       Line1(CurrentNo).Y2 = Dot2.Top + Y
  126.     End If
  127. End Sub
  128.  
  129. Sub Dot2_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  130.     If (Button = 1) And (SelectObject$ = "line") Then
  131.       Dot2.Move (Line1(CurrentNo).X2 - Dot2.Width / 2), (Line1(CurrentNo).Y2 - Dot2.Height / 2)
  132.       Dot1.Visible = True: Dot2.Visible = True
  133.     End If
  134. End Sub
  135.  
  136. Sub DotLD_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  137.     If Button = 1 Then
  138.       Call DotAllHide
  139.       Select Case SelectObject$
  140.         Case "rectangle", "roundrectangle", "circle", "text", "diamond":
  141.           DragX = X: DragY = Y
  142.       End Select
  143.     End If
  144.  
  145. End Sub
  146.  
  147. Sub DotLD_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  148.     DotLD.MousePointer = 6
  149.     If Button = 1 Then
  150.       Select Case SelectObject$
  151.         Case "text":                           'X_LD                          Y_LD                          X_RU                          Y_RU
  152.           Call ShapeLDZoom(Text1(TextNo), X, Y, DotLD.Left + DotLD.Width / 2, DotLD.Top + DotLD.Height / 2, DotRU.Left + DotRU.Width / 2, DotRU.Top + DotRU.Height / 2)
  153.         Case "rectangle":                              'X_LD                          Y_LD                          X_RU                          Y_RU
  154.           Call ShapeLDZoom(Rectangle1(CurrentNo), X, Y, DotLD.Left + DotLD.Width / 2, DotLD.Top + DotLD.Height / 2, DotRU.Left + DotRU.Width / 2, DotRU.Top + DotRU.Height / 2)
  155.         Case "roundrectangle":                              'X_LD                          Y_LD                          X_RU                          Y_RU
  156.           Call ShapeLDZoom(Roundrectangle1(CurrentNo), X, Y, DotLD.Left + DotLD.Width / 2, DotLD.Top + DotLD.Height / 2, DotRU.Left + DotRU.Width / 2, DotRU.Top + DotRU.Height / 2)
  157.         Case "circle":                              'X_LD                          Y_LD                          X_RU                          Y_RU
  158.           Call ShapeLDZoom(Circle1(CurrentNo), X, Y, DotLD.Left + DotLD.Width / 2, DotLD.Top + DotLD.Height / 2, DotRU.Left + DotRU.Width / 2, DotRU.Top + DotRU.Height / 2)
  159.         Case "diamond":                             'X_LD                          Y_LD                          X_RU                          Y_RU
  160.           Call ShapeLDZoom(Diamond(CurrentNo), X, Y, DotLD.Left + DotLD.Width / 2, DotLD.Top + DotLD.Height / 2, DotRU.Left + DotRU.Width / 2, DotRU.Top + DotRU.Height / 2)
  161.           Call DiamondDraw(Diamond(CurrentNo), CurrentNo)
  162.         End Select
  163.     End If
  164. End Sub
  165.  
  166. Sub DotLD_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  167.     Select Case SelectObject$
  168.       Case "text":           Call Shape_FourDotMove(Text1(TextNo))
  169.       Case "rectangle":      Call Shape_FourDotMove(Rectangle1(CurrentNo))
  170.       Case "roundrectangle": Call Shape_FourDotMove(Roundrectangle1(CurrentNo))
  171.       Case "circle":         Call Shape_FourDotMove(Circle1(CurrentNo))
  172.       Cas